package cn.microven.mindmap.controller.menu;

import cn.microven.mindmap.oprations.ChangeLayoutOperation;
import cn.microven.mindmap.struture.MindMap;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.layout.AnchorPane;

import java.net.URL;
import java.util.ResourceBundle;

public class LayoutMenu implements Initializable {

    @FXML
    public AnchorPane left;

    @FXML
    public AnchorPane right;

    @FXML
    public AnchorPane bothSide;

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        left.setOnMouseClicked((mouseEvent -> {
            MindMap.getInstance().castLayout("Left");
        }));

        right.setOnMouseClicked((mouseEvent -> {
            MindMap.getInstance().castLayout("Right");
        }));

        bothSide.setOnMouseClicked((mouseEvent ->{
            MindMap.getInstance().castLayout("BothSide");
        }));
    }
}
